import logging
import yagmail
def log_ele():
    logging.basicConfig(level=logging.DEBUG,format='%(levelno)s_%(asctime)s_%(message)s',handlers=[
        logging.StreamHandler(),
        logging.Formatter('log.txt')
    ])
def send_email(a):
    email=yagmail.SMTP(user='2966471538@qq.com',password='wqkdvqyywfmxdfif',host='smtp.qq.com')
    email.send(to='2966471538@qq.com',subject='测试报告',contents='这是一份报告',attachments=a)
